package com.example.park_management.controller;


import com.example.park_management.entity.User;
import com.example.park_management.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@CrossOrigin
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    UserService userService;
    @RequestMapping("zuce")
    public boolean zuce(User user){
        //注册就用了 mybatis-plus save
        Boolean a = userService.save(user);
        return a;
    }
    @RequestMapping("login")
    public User login(User user){
        User re = userService.login(user);
        if (re != null){
            return re;
        }
        return null;
    }

}
